
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1.1 快速上手 · smartboot 中文指南</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../2.2-Spring集成/" />
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"smartboot","repo":"smart-socket","type":"star","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    关于smartboot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    smart-socket 使用手册
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../">
            
                <a href="../../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" >
            
                <span>
            
                    
                    第一章 smart-socket开发指南
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.2.2.1" data-path="./">
            
                <a href="./">
            
                    
                    1.1 快速上手
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../2.2-Spring集成/">
            
                <a href="../2.2-Spring集成/">
            
                    
                    1.2 Spring集成smart-socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.3" data-path="../SUMMARY.html">
            
                <a href="../SUMMARY.html">
            
                    
                    小结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../chapter-2/">
            
                <a href="../../chapter-2/">
            
                    
                    第二章 源码解析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="../../chapter-2/核心接口/">
            
                <a href="../../chapter-2/核心接口/">
            
                    
                    2.1 核心接口与状态机
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="../../chapter-2/服务端/">
            
                <a href="../../chapter-2/服务端/">
            
                    
                    2.2 服务端
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="../../chapter-2/客户端/">
            
                <a href="../../chapter-2/客户端/">
            
                    
                    2.3 客户端
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="../../chapter-2/AioSession/">
            
                <a href="../../chapter-2/AioSession/">
            
                    
                    2.4 会话AioSession
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="../../chapter-2/SUMMARY.html">
            
                <a href="../../chapter-2/SUMMARY.html">
            
                    
                    2.5 小结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../chapter-3/">
            
                <a href="../../chapter-3/">
            
                    
                    第三章 通信协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="../../chapter-3/1-消息归类/">
            
                <a href="../../chapter-3/1-消息归类/">
            
                    
                    3.1 消息归类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="../../BLANK.html">
            
                <a href="../../BLANK.html">
            
                    
                    3.2 半包/粘包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="../../BLANK.html">
            
                <a href="../../BLANK.html">
            
                    
                    3.3 Http消息解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="../../BLANK.html">
            
                <a href="../../BLANK.html">
            
                    
                    3.4 RPC消息解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../../chapter-5/">
            
                <a href="../../chapter-5/">
            
                    
                    第四章 内存池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../../chapter-6/">
            
                <a href="../../chapter-6/">
            
                    
                    第五章 未来规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../../end/">
            
                <a href="../../end/">
            
                    
                    附录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    smart-http 实战手册
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../../smart-http/">
            
                <a href="../../../smart-http/">
            
                    
                    关于smart-http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" >
            
                <span>
            
                    
                    第一章 smart-http开发指南
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../../smart-http/chapter-1/">
            
                <a href="../../../smart-http/chapter-1/">
            
                    
                    1.1 快速上手
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../../smart-http/chapter-1/http_route.html">
            
                <a href="../../../smart-http/chapter-1/http_route.html">
            
                    
                    1.2 请求路由
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3" data-path="../../../smart-http/chapter-1/file_upload.html">
            
                <a href="../../../smart-http/chapter-1/file_upload.html">
            
                    
                    1.3 文件上传/下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.4" data-path="../../../smart-http/chapter-1/websocket.html">
            
                <a href="../../../smart-http/chapter-1/websocket.html">
            
                    
                    1.4 WebSocket
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    技术分享
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../../share/rpc/smart-socket-rpc.html">
            
                <a href="../../../share/rpc/smart-socket-rpc.html">
            
                    
                    smart-socket实现RPC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../../share/firstfit/readme.html">
            
                <a href="../../../share/firstfit/readme.html">
            
                    
                    内存管理-首次适应算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../../share/thread/readme.html">
            
                <a href="../../../share/thread/readme.html">
            
                    
                    Thread知多少
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../../../donation.html">
            
                <a href="../../../donation.html">
            
                    
                    关于捐赠
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >1.1 快速上手</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x5FEB;&#x901F;&#x4E0A;&#x624B;">&#x5FEB;&#x901F;&#x4E0A;&#x624B;</h2>
<p>JDK1.7 &#x662F;&#x91C7;&#x7528; smart-socket &#x8FDB;&#x884C;&#x5F00;&#x53D1;&#x7684;&#x6700;&#x4F4E;&#x7248;&#x672C;&#x8981;&#x6C42;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x8FD8;&#x5728;&#x7528; JDK1.6 &#x6216;&#x8005;&#x66F4;&#x4F4E;&#x7684;&#x7248;&#x672C;&#xFF0C;&#x8BF7;&#x5148;&#x5347;&#x7EA7;&#x60A8;&#x7684; JDK&#x3002;
&#x5982;&#x679C;&#x60A8;&#x4ECE;&#x4E8B;&#x7684;&#x662F; Android &#x901A;&#x4FE1;&#x5F00;&#x53D1;&#xFF0C;&#x53EF;&#x80FD;&#x4F1A;&#x9762;&#x4E34;&#x4F4E;&#x7248;&#x672C;&#x7CFB;&#x7EDF;&#x800C;&#x65E0;&#x6CD5;&#x4F7F;&#x7528; smart-socket &#x7684;&#x95EE;&#x9898;&#xFF0C;&#x4E3A;&#x6B64;&#x6211;&#x4EEC;&#x4E13;&#x4E3A;&#x91C7;&#x7528; NIO &#x6280;&#x672F;&#x5F00;&#x53D1;&#x4E86; Android &#x7248;&#x672C;&#x901A;&#x4FE1;&#x6846;&#x67B6; smart-ioc&#xFF0C;&#x56E0;&#x5176;&#x4E0D;&#x5C5E;&#x4E8E;&#x672C;&#x7AE0;&#x4E3B;&#x89D2;&#x6545;&#x6682;&#x4E0D;&#x591A;&#x505A;&#x4ECB;&#x7ECD;&#x3002;
&#x9664;&#x4E86;JDK&#xFF0C;&#x5EFA;&#x8BAE;&#x4E8B;&#x5148;&#x51C6;&#x5907;&#x4E00;&#x6B3E;&#x987A;&#x624B;&#x7684;IDE&#xFF0C;&#x5E76;&#x642D;&#x5EFA;&#x597D;Maven&#x73AF;&#x5883;&#xFF0C;&#x4F1A;&#x6709;&#x66F4;&#x9AD8;&#x7684;&#x5F00;&#x53D1;&#x6548;&#x7387;&#x3002;</p>
<p>smart-socket &#x5E76;&#x4E0D;&#x4F9D;&#x8D56;&#x9664; <code>slf4j-api</code> &#x4E4B;&#x5916;&#x7684;&#x5176;&#x4ED6;&#x7B2C;&#x4E09;&#x65B9; jar &#x5305;&#xFF0C;&#x6240;&#x4EE5;&#x4F60;&#x53EF;&#x4EE5;&#x5F88;&#x8F7B;&#x6613;&#x7684;&#x5C06;&#x5B83;&#x96C6;&#x6210;&#x5230;&#x4F60;&#x7684;&#x9879;&#x76EE;&#x4E2D;&#xFF0C;&#x65E0;&#x9700;&#x62C5;&#x5FC3;&#x4F1A;&#x53D1;&#x751F; jar &#x5305;&#x51B2;&#x7A81;&#x7684;&#x95EE;&#x9898;&#x3002;
&#x5F97;&#x76CA;&#x4E8E; smart-socket &#x4EE3;&#x7801;&#x91CF;&#x6781;&#x5C11;&#x7684;&#x7279;&#x6027;&#xFF0C;&#x4F60;&#x751A;&#x81F3;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x76F4;&#x63A5;&#x5C06;&#x6E90;&#x7801;&#x62F7;&#x8D1D;&#x5230;&#x81EA;&#x5DF1;&#x7684;&#x9879;&#x76EE;&#x4E2D;&#xFF0C;&#x7EF4;&#x62A4;&#x4E00;&#x4E2A;&#x4E13;&#x5C5E;&#x4E8E;&#x4F60;&#x7684;&#x79C1;&#x6709;&#x7248; smart-socket&#x3002;</p>
<p>&#x76EE;&#x524D; smart-socket &#x6258;&#x7BA1;&#x5728;&#x7801;&#x4E91;&#x548C;Github&#xFF0C;&#x6709;&#x9700;&#x8981;&#x7684;&#x53EF;&#x524D;&#x5F80;&#x4E0B;&#x8F7D;&#x9879;&#x76EE;&#x6E90;&#x7801;&#x3002;</p>
<ul>
<li><p>&#x7801;&#x4E91; <a href="https://gitee.com/smartboot/smart-socket" target="_blank">https://gitee.com/smartboot/smart-socket</a></p>
</li>
<li><p>GITHUB <a href="https://github.com/smartboot/smart-socket" target="_blank">https://github.com/smartboot/smart-socket</a></p>
</li>
</ul>
<p>&#x4E0D;&#x8FC7;&#x6211;&#x4EEC;&#x66F4;&#x63A8;&#x8350;&#x7684;&#x662F;&#x91C7;&#x7528; maven &#x65B9;&#x5F0F;&#x5F15;&#x7528; smart-socket &#xFF0C;&#x8FD9;&#x6837;&#x4FBF;&#x53EF;&#x4EAB;&#x53D7;&#x7531;&#x4F5C;&#x8005;&#x63D0;&#x4F9B;&#x540E;&#x7EED;&#x7684;&#x7248;&#x672C;&#x5347;&#x7EA7;&#x670D;&#x52A1;&#x3002;</p>
<pre><code class="lang-xml">  <span class="hljs-comment">&lt;!-- &#x672C;&#x4E66;&#x4E2D;&#x7684;&#x7248;&#x672C;&#x53F7;&#x53EF;&#x80FD;&#x4E0D;&#x662F;&#x6700;&#x65B0;&#x7684;&#xFF0C;&#x4EE5;&#x5B9E;&#x9645;maven&#x4ED3;&#x5E93;&#x4E2D;&#x7684;&#x7248;&#x672C;&#x53F7;&#x4E3A;&#x51C6; --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.smartboot.socket<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>aio-core<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.4.5<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
</code></pre>
<h3 id="&#x7EBF;&#x7A0B;&#x6A21;&#x578B;">&#x7EBF;&#x7A0B;&#x6A21;&#x578B;</h3>
<p>&#x7528;&#x6237;&#x9009;&#x62E9;&#x901A;&#x4FE1;&#x6846;&#x67B6;&#x901A;&#x5E38;&#x662F;&#x4E3A;&#x4E86;&#x6EE1;&#x8DB3;&#x670D;&#x52A1;&#x7AEF;&#x7684;&#x5F00;&#x53D1;&#xFF0C;&#x6BD5;&#x7ADF;&#x5BA2;&#x6237;&#x7AEF;&#x901A;&#x4FE1;&#x6BD4;&#x8F83;&#x7B80;&#x5355;&#xFF0C;&#x5373;&#x4FBF;&#x662F;&#x4F20;&#x7EDF;&#x7684;BIO&#x90FD;&#x662F;&#x4E2A;&#x6027;&#x4EF7;&#x6BD4;&#x8F83;&#x9AD8;&#x7684;&#x9009;&#x9879;&#x3002;&#x6240;&#x4EE5;&#x672C;&#x4E66;&#x4F1A;&#x66F4;&#x4FA7;&#x91CD;&#x4E8E;&#x5206;&#x4EAB; smart-socket &#x5728;&#x670D;&#x52A1;&#x7AEF;&#x901A;&#x4FE1;&#x65B9;&#x9762;&#x7684;&#x5B9E;&#x8DF5;&#xFF0C;&#x5728;&#x52A8;&#x624B;&#x7F16;&#x7801;&#x4E4B;&#x524D;&#x5E0C;&#x671B;&#x8BFB;&#x8005;&#x670B;&#x53CB;&#x5148;&#x4ED4;&#x7EC6;&#x7406;&#x89E3;&#x4E0B;&#x56FE;&#x63CF;&#x7ED8;&#x7684; smart-socket &#x670D;&#x52A1;&#x7AEF;&#x7EBF;&#x7A0B;&#x6A21;&#x578B;&#xFF0C;&#x5BF9;&#x4E8E;&#x4E4B;&#x540E;&#x7684;&#x5B66;&#x4E60;&#x3001;&#x5E94;&#x7528;&#x6709;&#x5F88;&#x5927;&#x7684;&#x5E2E;&#x52A9;&#x3002;</p>
<p><img src="thread_model.png" alt="&#x7EBF;&#x7A0B;&#x6A21;&#x578B;"></p>
<p>smart-socket &#x670D;&#x52A1;&#x7AEF;&#x5185;&#x90E8;&#x8BBE;&#x6709;&#x4E09;&#x7C7B;&#x7EBF;&#x7A0B;&#xFF1A;</p>
<ul>
<li>Accept&#x7EBF;&#x7A0B;<br> &#x63A5;&#x53D7;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x8FDE;&#x63A5;&#x8BF7;&#x6C42;&#xFF0C;&#x5B8C;&#x6210;&#x8FDE;&#x63A5;&#x4F1A;&#x8BDD;&#xFF08;AioSession&#xFF09;&#x5B9E;&#x4F8B;&#x5316;&#x540E;&#x4FBF;&#x5F00;&#x59CB;&#x76D1;&#x542C;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x6570;&#x636E;&#x8BF7;&#x6C42;&#x3002;</li>
<li>Worker&#x7EBF;&#x7A0B;&#x7EC4;<br> Worker&#x7EBF;&#x7A0B;&#x662F;&#x4E00;&#x7EC4;&#x7EBF;&#x7A0B;&#x6C60;&#xFF0C;&#x8BE5;&#x7EBF;&#x7A0B;&#x7684;&#x804C;&#x8D23;&#x4E3B;&#x8981;&#x662F;&#x5904;&#x7406;&#x670D;&#x52A1;&#x7AEF;&#x7684;&#x8BFB;&#x5199;&#x4E8B;&#x4EF6;&#x3002;&#x5176;&#x4E2D;&#x8BFB;&#x4E8B;&#x4EF6;&#x7684;&#x5904;&#x7406;&#x4F1A;&#x76F8;&#x5BF9;&#x590D;&#x6742;&#xFF0C;&#x6D89;&#x53CA;&#x5230;&#x5DF2;&#x8BFB;&#x6570;&#x636E;&#x7684;&#x89E3;&#x7801;&#xFF08;decode&#xFF09;&#x3001;&#x4E1A;&#x52A1;&#x5904;&#x7406;&#xFF08;process&#xFF09;&#x548C;&#x54CD;&#x5E94;&#x6570;&#x636E;&#x8F93;&#x51FA;&#xFF08;write&#xFF09;&#x64CD;&#x4F5C;&#x3002;</li>
<li>Watchman&#x7EBF;&#x7A0B;<br> &#x987E;&#x540D;&#x601D;&#x4E49;&#xFF0C;&#x8BE5;&#x7EBF;&#x7A0B;&#x5145;&#x5F53;&#x76D1;&#x5DE5;&#x7684;&#x89D2;&#x8272;&#xFF0C;&#x76D1;&#x89C6;&#x7684;&#x5BF9;&#x8C61;&#x662F;Worker&#x7EBF;&#x7A0B;&#x7EC4;&#x5F85;&#x5904;&#x7406;&#x7684;&#x4EFB;&#x52A1;&#x3002;&#x8BE5;&#x7EBF;&#x7A0B;&#x53EA;&#x80FD;&#x5904;&#x7406;&#x8BFB;&#x56DE;&#x8C03;&#xFF08;read callback&#xFF09;&#x4E8B;&#x4EF6;&#xFF0C;&#x5B83;&#x7684;&#x5B58;&#x5728;&#x610F;&#x4E49;&#x5728;&#x4E8E;&#x6FC0;&#x6D3B;&#x53EF;&#x80FD;&#x6B63;&#x5904;&#x4E8E;&#x4F11;&#x7720;&#x72B6;&#x6001;&#x7684; Worker &#x7EBF;&#x7A0B;&#x7EE7;&#x7EED;&#x5DE5;&#x4F5C;&#x3002;</li>
</ul>
<h3 id="&#x5185;&#x5B58;&#x6C60;">&#x5185;&#x5B58;&#x6C60;</h3>
<p>&#x5185;&#x5B58;&#x6C60;&#x5927;&#x5BB6;&#x5E94;&#x8BE5;&#x5E76;&#x4E0D;&#x964C;&#x751F;&#xFF0C;&#x5728; smart-socket &#x4E2D;&#x7EF4;&#x62A4;&#x4E86;&#x4E00;&#x5957;&#x5185;&#x5B58;&#x6C60;&#x4E3A;&#x901A;&#x4FE1;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x6027;&#x80FD;&#x4E0E;&#x7A33;&#x5B9A;&#x6027;&#x7684;&#x652F;&#x6491;&#x3002;&#x5173;&#x4E8E; smart-socket &#x5185;&#x5B58;&#x6C60;&#x5728;&#x540E;&#x6587;&#x6709;&#x8BE6;&#x7EC6;&#x7684;&#x4ECB;&#x7ECD;&#xFF0C;&#x6B64;&#x5904;&#x5148;&#x4E3A;&#x8BFB;&#x8005;&#x9610;&#x8FF0;&#x5185;&#x5B58;&#x6C60;&#x4E2D;&#x7684;&#x51E0;&#x4E2A;&#x57FA;&#x672C;&#x6982;&#x5FF5;&#x4EE5;&#x53CA;&#x5B83;&#x4EEC;&#x4E4B;&#x95F4;&#x7684;&#x5173;&#x7CFB;&#xFF0C;&#x89C1;&#x4E0B;&#x56FE;&#x3002;</p>
<p><img src="buffer_pool.png" alt="&#x5185;&#x5B58;&#x6C60;"></p>
<ul>
<li>&#x5185;&#x5B58;&#x6C60;&#xFF1A;BufferPool<br>  &#x4E00;&#x4E2A;&#x5185;&#x5B58;&#x6C60;&#x4E2D;&#x5305;&#x542B;&#x4E86;&#x591A;&#x4E2A;&#x5185;&#x5B58;&#x9875;<code>BufferPage</code>&#xFF0C;&#x4E3A;&#x5185;&#x5B58;&#x7533;&#x8BF7;&#x6E90;&#x63D0;&#x4F9B;&#x5185;&#x5B58;&#x9875;&#x7684;&#x5206;&#x914D;&#x7B56;&#x7565;&#xFF0C;&#x5E76;&#x4E14;&#x8FD0;&#x884C;&#x7740;&#x4F4E;&#x4F18;&#x5148;&#x7EA7;&#x5F02;&#x6B65;&#x4EFB;&#x52A1;&#x5C06;&#x672A;&#x4F7F;&#x7528;&#x7684;&#x5185;&#x5B58;&#x5757;<code>chunk</code>&#x56DE;&#x6536;&#x81F3;&#x5185;&#x5B58;&#x9875;<code>BufferPage</code>&#x3002;</li>
<li>&#x5185;&#x5B58;&#x9875;&#xFF1A;BufferPage<br> &#x5176;&#x672C;&#x8D28;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x7531;&#x7528;&#x6237;&#x6307;&#x5B9A;&#x5927;&#x5C0F;&#x7684; ByteBuffer &#x5BF9;&#x8C61;&#xFF0C;DirectByteBuffer &#x548C; HeapByteBuffer &#x7686;&#x53EF;&#x3002;&#x901A;&#x8FC7;&#x4E8B;&#x5148;&#x521D;&#x59CB;&#x5316;&#x8DB3;&#x591F;&#x5927;&#x5C0F;&#x7684;&#x5185;&#x5B58;&#x9875;&#xFF0C;&#x670D;&#x52A1;&#x8FD0;&#x884C;&#x671F;&#x95F4;&#x53EF;&#x5FEB;&#x901F;&#x54CD;&#x5E94;&#x5185;&#x5B58;&#x9700;&#x6C42;&#x3002;</li>
<li>&#x5185;&#x5B58;&#x5757;&#xFF1A;chunk<br> &#x4ECE; BufferPage &#x4E2D;&#x5212;&#x5206;&#x51FA;&#x6765;&#x7684;&#x5C0F;&#x5757;&#x5185;&#x5B58;&#x4EE5;&#x6EE1;&#x8DB3;&#x901A;&#x4FE1;&#x6240;&#x9700;&#xFF0C;&#x5185;&#x5B58;&#x5757;&#x7684;&#x7684;&#x7533;&#x8BF7;&#x5C3D;&#x91CF;&#x9075;&#x5FAA;&#x6309;&#x9700;&#x7533;&#x8BF7;&#xFF0C;&#x7528;&#x5B8C;&#x5373;&#x8FD8;&#x539F;&#x5219;&#x3002;&#x5F53;&#x5185;&#x5B58;&#x9875;&#x4E2D;&#x5269;&#x4F59;&#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x4EE5;&#x6EE1;&#x8DB3;&#x7533;&#x8BF7;&#x6E90;&#x9700;&#x6C42;&#x5927;&#x5C0F;&#x65F6;&#xFF0C;smart-socket &#x5C06;&#x5411; JVM &#x7533;&#x8BF7;&#x4E34;&#x65F6;&#x5185;&#x5B58;&#x5757;&#x3002;</li>
</ul>
<p><strong>&#x7EBF;&#x7A0B;&#x6A21;&#x578B;&#x548C;&#x5185;&#x5B58;&#x6C60;&#x4E24;&#x8005;&#x76F8;&#x8F85;&#x76F8;&#x6210;&#xFF0C;&#x6784;&#x5EFA;&#x51FA;&#x4E86;&#x4E00;&#x4E2A;&#x5B8C;&#x6210;&#x7684;&#x901A;&#x4FE1;&#x5185;&#x6838;&#x3002;&#x719F;&#x7EC3;&#x638C;&#x63E1;&#x5E76;&#x52A0;&#x4EE5;&#x5408;&#x7406;&#x7684;&#x5E94;&#x7528;&#xFF0C;&#x6240;&#x7F16;&#x5199;&#x7684;&#x901A;&#x4FE1;&#x670D;&#x52A1;&#x4FBF;&#x4F1A;&#x6709;&#x7740;&#x975E;&#x5E38;&#x51FA;&#x8272;&#x7684;&#x8868;&#x73B0;&#x3002;</strong></p>
<p>&#x63A5;&#x4E0B;&#x91CC;&#x6211;&#x4EEC;&#x6B63;&#x5F0F;&#x4E3A;&#x5927;&#x5BB6;&#x6F14;&#x793A;&#x5982;&#x679C;&#x8FD0;&#x7528; smart-socket &#x8FDB;&#x884C;&#x57FA;&#x672C;&#x7684;&#x901A;&#x4FE1;&#x5F00;&#x53D1;&#x3002;</p>
<h3 id="111-&#x5DE5;&#x7A0B;&#x642D;&#x5EFA;">1.1.1 &#x5DE5;&#x7A0B;&#x642D;&#x5EFA;</h3>
<p>&#x672C;&#x7AE0;&#x4EE5;Maven&#x5DE5;&#x7A0B;&#x4E3A;&#x4F8B;&#x4E3A;&#x5927;&#x5BB6;&#x6F14;&#x793A;&#x57FA;&#x4E8E;smart-socket&#x5B9E;&#x73B0;socket&#x5F00;&#x53D1;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x5DF2;&#x7ECF;&#x6709;&#x73B0;&#x6210;&#x7684;&#x5DE5;&#x7A0B;&#x4EC5;&#x9700;&#x5F15;&#x5165;pom.xml&#x4F9D;&#x8D56;&#x5373;&#x53EF;&#xFF0C;&#x5426;&#x5219;&#x8BF7;&#x5148;&#x5EFA;&#x7ACB;&#x4E00;&#x4E2A;&#x9879;&#x76EE;&#x5DE5;&#x7A0B;&#x3002;</p>
<pre><code class="lang-xml"><span class="php"><span class="hljs-meta">&lt;?</span>xml version=<span class="hljs-string">&quot;1.0&quot;</span> encoding=<span class="hljs-string">&quot;UTF-8&quot;</span><span class="hljs-meta">?&gt;</span></span>
<span class="hljs-tag">&lt;<span class="hljs-name">project</span> <span class="hljs-attr">xmlns</span>=<span class="hljs-string">&quot;http://maven.apache.org/POM/4.0.0&quot;</span>
         <span class="hljs-attr">xmlns:xsi</span>=<span class="hljs-string">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
         <span class="hljs-attr">xsi:schemaLocation</span>=<span class="hljs-string">&quot;http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">modelVersion</span>&gt;</span>4.0.0<span class="hljs-tag">&lt;/<span class="hljs-name">modelVersion</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.smartboot.socket<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>demo<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.0-SNAPSHOT<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">dependencies</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.smartboot.socket<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>aio-core<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.4.5<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.slf4j<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>slf4j-simple<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.7.25<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">dependencies</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">project</span>&gt;</span>
</code></pre>
<p>&#x6B64;&#x5904;&#x6211;&#x4EEC;&#x9009;&#x7528;&#x4E86; smart-socket &#x76EE;&#x524D;&#x7684;&#x6700;&#x65B0;&#x5305;&#xFF1A;aio-core 1.4.5&#x3002;&#x51FA;&#x4E8E;&#x7CBE;&#x7B80; pom &#x4F9D;&#x8D56;&#x548C;&#x4E0D;&#x7ED1;&#x67B6;&#x7528;&#x6237;&#x5BF9;&#x65E5;&#x5FD7;&#x6846;&#x67B6;&#x9009;&#x62E9;&#x6743;&#x8003;&#x8651;&#xFF0C;smart-socket &#x975E;&#x5E38;&#x8D34;&#x5FC3;&#x7684;&#x4EC5;&#x4F9D;&#x8D56; slf4j-api&#xFF0C;&#x6240;&#x4EE5;&#x5F00;&#x53D1;&#x4EBA;&#x5458;&#x53EF;&#x4EE5;&#x81EA;&#x7531;&#x9009;&#x62E9;&#x4EFB;&#x610F;&#x7684;&#x65E5;&#x5FD7;&#x6846;&#x67B6;&#x96C6;&#x6210;&#x5230;&#x9879;&#x76EE;&#x4E2D;&#x3002;&#x4F8B;&#x5982;&#x672C;&#x6B21;&#x7684;&#x793A;&#x4F8B;&#x5DE5;&#x7A0B;&#x6211;&#x4EEC;&#x5F15;&#x5165; <code>slf4j-simple</code> &#x4F9D;&#x8D56;&#x4EE5;&#x4FBF;&#x89C2;&#x5BDF;&#x8FD0;&#x884C;&#x65F6;&#x65E5;&#x5FD7;&#x3002;</p>
<h3 id="112-&#x534F;&#x8BAE;&#x7EA6;&#x5B9A;">1.1.2 &#x534F;&#x8BAE;&#x7EA6;&#x5B9A;</h3>
<p>&#x5DE5;&#x7A0B;&#x642D;&#x5EFA;&#x5B8C;&#x6BD5;&#x540E;&#xFF0C;&#x8FD8;&#x9700;&#x9002;&#x5F53;&#x4E86;&#x89E3;&#x4E00;&#x4E0B;&#x901A;&#x4FE1;&#x5F00;&#x53D1;&#x7684;&#x57FA;&#x7840;&#x77E5;&#x8BC6;&#xFF1A;&#x534F;&#x8BAE;&#x3002;&#x4F5C;&#x8005;&#x63A5;&#x89E6;&#x4E0D;&#x5C11;&#x521A;&#x5F00;&#x59CB;&#x5199;&#x901A;&#x4FE1;&#x7A0B;&#x5E8F;&#x7684;&#x5F00;&#x53D1;&#xFF0C;&#x4ED6;&#x4EEC;&#x666E;&#x904D;&#x5B58;&#x5728;&#x7684;&#x95EE;&#x9898;&#x662F;&#x6CA1;&#x6709;&#x6B63;&#x786E;&#x7406;&#x89E3;&quot;&#x534F;&#x8BAE;&quot;&#x7684;&#x6982;&#x5FF5;&#xFF0C;&#x4EE5;&#x53CA;&quot;&#x534F;&#x8BAE;&quot;&#x5728;&#x6574;&#x4E2A;&#x901A;&#x4FE1;&#x8FC7;&#x7A0B;&#x4E2D;&#x6240;&#x626E;&#x6F14;&#x7684;&quot;&#x4FE1;&#x606F;&#x7FFB;&#x8BD1;&#x5B98;&quot;&#x8FD9;&#x4E2A;&#x975E;&#x5E38;&#x91CD;&#x8981;&#x7684;&#x89D2;&#x8272;&#x3002;</p>
<p>&#x901A;&#x4FE1;&#x4E2D;&#x6240;&#x8BF4;&#x7684;&#x534F;&#x8BAE;&#x662F;&#x6307;&#x53CC;&#x65B9;&#x5B9E;&#x4F53;&#x5B8C;&#x6210;&#x901A;&#x4FE1;&#x6216;&#x670D;&#x52A1;&#x6240;&#x5FC5;&#x987B;&#x9075;&#x5FAA;&#x7684;&#x89C4;&#x5219;&#x548C;&#x7EA6;&#x5B9A;&#x3002;
&#x534F;&#x8BAE;&#x5B9A;&#x4E49;&#x4E86;&#x6570;&#x636E;&#x5355;&#x5143;&#x4F7F;&#x7528;&#x7684;&#x683C;&#x5F0F;&#xFF0C;&#x4FE1;&#x606F;&#x5355;&#x5143;&#x5E94;&#x8BE5;&#x5305;&#x542B;&#x7684;&#x4FE1;&#x606F;&#x4E0E;&#x542B;&#x4E49;&#xFF0C;&#x8FDE;&#x63A5;&#x65B9;&#x5F0F;&#xFF0C;&#x4FE1;&#x606F;&#x53D1;&#x9001;&#x548C;&#x63A5;&#x6536;&#x7684;&#x65F6;&#x5E8F;&#xFF0C;&#x4ECE;&#x800C;&#x786E;&#x4FDD;&#x7F51;&#x7EDC;&#x4E2D;&#x6570;&#x636E;&#x987A;&#x5229;&#x5730;&#x4F20;&#x9001;&#x5230;&#x786E;&#x5B9A;&#x7684;&#x5730;&#x65B9;&#x3002;</p>
<p>&#x534F;&#x8BAE;&#x7684;&#x5236;&#x5B9A;&#xFF0C;&#x9700;&#x8981;&#x6EE1;&#x8DB3;&#x4E09;&#x8981;&#x7D20;&#xFF1A;</p>
<ol>
<li>&#x8BED;&#x6CD5;&#xFF1A;&#x7EA6;&#x5B9A;&#x901A;&#x4FE1;&#x7684;&#x6570;&#x636E;&#x683C;&#x5F0F;&#xFF0C;&#x7F16;&#x7801;&#xFF0C;&#x4FE1;&#x53F7;&#x7B49;&#x7EA7;</li>
<li>&#x8BED;&#x4E49;&#xFF1A;&#x5728;&#x8BED;&#x6CD5;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x4F20;&#x9012;&#x7684;&#x6570;&#x636E;&#x5185;&#x5BB9;</li>
<li>&#x5B9A;&#x65F6;&#x89C4;&#x5219;&#xFF1A;&#x660E;&#x786E;&#x901A;&#x4FE1;&#x5185;&#x5BB9;&#x7684;&#x65F6;&#x5E8F;</li>
</ol>
<p>&#x4E0B;&#x9762;&#x6211;&#x4EEC;&#x6765;&#x5B9A;&#x4E49;&#x4E00;&#x5957;&#x7B80;&#x5355;&#x7684;&#x901A;&#x4FE1;&#x534F;&#x8BAE;&#xFF0C;&#x5E76;&#x57FA;&#x4E8E;&#x8BE5;&#x534F;&#x8BAE;&#x5B9E;&#x73B0;&#x670D;&#x52A1;&#x7AEF;&#x4E0E;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x4FE1;&#x606F;&#x4EA4;&#x4E92;&#x3002;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF0C;&#x6BCF;&#x4E2A;&#x5355;&#x5143;&#x683C;&#x8868;&#x793A;&#x4E00;&#x4E2A;Byte&#xFF0C;&#x6574;&#x4E2A;&#x6D88;&#x606F;&#x7531;&#x4E24;&#x90E8;&#x5206;&#x7EC4;&#x6210;&#xFF1A;</p>
<ul>
<li>&#x6D88;&#x606F;&#x5934;&#xFF1A;&#x56FA;&#x5B9A;&#x4E00;&#x4E2A;byte&#x957F;&#x5EA6;</li>
<li>&#x6D88;&#x606F;&#x4F53;&#xFF1A;&#x6839;&#x636E;&#x6D88;&#x606F;&#x4F53;&#x4E2D;&#x7684;&#x6570;&#x503C;&#x51B3;&#x5B9A;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#x3002;&#x5F53;N&#x7B49;&#x4E8E;1&#xFF0C;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#x4E5F;&#x5219;&#x4E3A;1&#xFF1B;&#x5F53;N&#x7B49;&#x4E8E;10&#xFF0C;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#x5219;&#x4E3A;10&#x3002;</li>
</ul>
<p><img src="2.1.2_1.png" width="40%"></p>
<p>&#x6309;&#x7167;&#x4E0A;&#x8FF0;&#x89C4;&#x5219;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5F97;&#x51FA;&#x4E00;&#x4E2A;&#x516C;&#x5F0F;&#xFF1A;&#x6D88;&#x606F;&#x957F;&#x5EA6;=&#x6D88;&#x606F;&#x5934;&#x957F;&#x5EA6;+&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#xFF0C;&#x800C;&#x6D88;&#x606F;&#x4F53;&#x7684;&#x957F;&#x5EA6;&#x53D6;&#x51B3;&#x4E8E;&#x6D88;&#x606F;&#x5934;&#x4E2D;&#x7684;&#x6570;&#x503C;&#x3002;&#x8FD9;&#x5C31;&#x662F;&#x6240;&#x8C13;&#x7684;&#x534F;&#x8BAE;&#xFF0C;&#x90A3;&#x6839;&#x636E;&#x8FD9;&#x4E2A;&#x534F;&#x8BAE;&#xFF0C;&#x6211;&#x4EEC;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x4F20;&#x8F93;&#x5462;&#xFF1F;</p>
<p>&#x4EE5;&#x5B57;&#x7B26;&#x4E32;&#x201C;socket&#x201D;&#x4E3A;&#x4F8B;&#xFF0C;&#x6309;&#x7167;&#x4E0A;&#x8FF0;&#x534F;&#x8BAE;&#x8FDB;&#x884C;&#x7F16;&#x7801;&#x540E;&#x7684;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;</p>
<p><img src="2.1.1_2.png" width="50%"></p>
<p>&#x8BE5;&#x534F;&#x8BAE;&#x91C7;&#x7528;smart-socket&#x53EF;&#x7528;&#x5982;&#x4E0B;&#x7B97;&#x6CD5;&#x5B9E;&#x73B0;&#x89E3;&#x7801;&#xFF1A;</p>
<ol>
<li>&#x6807;&#x5FD7;&#x5F53;&#x524D;buffer&#x7684;postion&#x4F4D;&#x7F6E;&#xFF1B;</li>
<li>&#x83B7;&#x53D6;&#x672C;&#x6B21;&#x6D88;&#x606F;&#x7684;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#xFF0C;position&#x9012;&#x589E;1&#x4F4D;&#xFF1B;</li>
<li>&#x5224;&#x65AD;&#x5F53;&#x524D;&#x5DF2;&#x8BFB;&#x7684;&#x6570;&#x636E;&#x957F;&#x5EA6;&#x662F;&#x5426;&#x6EE1;&#x8DB3;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#xFF1B;</li>
<li><strong>&#x51FA;&#x73B0;&#x534A;&#x5305;&#xFF0C;&#x6570;&#x636E;&#x4E0D;&#x5B8C;&#x6574;&#xFF0C;&#x91CD;&#x7F6E;&#x6807;&#x5FD7;&#x4F4D;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;null&#x7EC8;&#x6B62;&#x672C;&#x6B21;&#x89E3;&#x7801;</strong>&#xFF1B;</li>
<li>buffer&#x4E2D;&#x5305;&#x542B;&#x5B8C;&#x6574;&#x7684;&#x6D88;&#x606F;&#x4F53;&#x5185;&#x5BB9;&#xFF0C;&#x5219;&#x8FDB;&#x884C;&#x8BFB;&#x53D6;&#xFF0C;postiton=postion+&#x589E;&#x52A0;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;;</li>
<li>&#x66F4;&#x65B0;&#x6807;&#x5FD7;&#x4F4D;</li>
<li>&#x5C06;&#x5DF2;&#x8BFB;&#x6570;&#x636E;&#x8F6C;&#x6362;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x5E76;&#x8FD4;&#x56DE;&#xFF0C;&#x89E3;&#x7801;&#x6210;&#x529F;&#x3002;</li>
</ol>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">StringProtocol</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">Protocol</span>&lt;<span class="hljs-title">String</span>&gt; </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">decode</span><span class="hljs-params">(ByteBuffer buffer, AioSession&lt;String&gt; session)</span> </span>{
        buffer.mark(); <span class="hljs-comment">// 1</span>
        <span class="hljs-keyword">byte</span> length = buffer.get(); <span class="hljs-comment">// 2</span>
        <span class="hljs-keyword">if</span> (buffer.remaining() &lt; length) { <span class="hljs-comment">// 3</span>
            buffer.reset(); <span class="hljs-comment">// 4</span>
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
        }
        <span class="hljs-keyword">byte</span>[] body = <span class="hljs-keyword">new</span> <span class="hljs-keyword">byte</span>[length];
        buffer.get(body); <span class="hljs-comment">// 5</span>
        buffer.mark(); <span class="hljs-comment">// 6</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> String(body); <span class="hljs-comment">// 7</span>
    }
}
</code></pre>
<p>&#x540C;&#x6837;&#x7684;&#x534F;&#x8BAE;&#x53EF;&#x4EE5;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x89E3;&#x6790;&#x7B97;&#x6CD5;&#xFF0C;&#x4E0D;&#x540C;&#x7B97;&#x6CD5;&#x7684;&#x4F18;&#x52A3;&#x5404;&#x4E0D;&#x76F8;&#x540C;&#x3002;&#x4F9D;&#x65E7;&#x4EE5;&#x6B64;&#x534F;&#x8BAE;&#x4E3A;&#x4F8B;&#xFF0C;&#x89E3;&#x6790;&#x7B97;&#x6CD5;&#x8FD8;&#x80FD;&#x8FD9;&#x6837;&#x5199;&#xFF1A;</p>
<ol>
<li>&#x91C7;&#x7528;&#x7EDD;&#x5BF9;&#x5B9A;&#x4F4D;&#x7684;&#x65B9;&#x5F0F;&#x8BC6;&#x522B;&#x6D88;&#x606F;&#x957F;&#x5EA6;&#xFF0C;&#x8BE5;&#x8BFB;&#x53D6;&#x65B9;&#x5F0F;&#x4E0D;&#x4F1A;&#x6539;&#x53D8;buffer&#x7684;position&#x503C;&#xFF1B;</li>
<li>&#x5224;&#x65AD;&#x5F53;&#x524D;buffer&#x4E2D;&#x5F85;&#x8BFB;&#x53D6;&#x7684;&#x6570;&#x636E;&#x957F;&#x5EA6;&#x662F;&#x5426;&#x6EE1;&#x8DB3;&#x6D88;&#x606F;&#x4F53;&#x957F;&#x5EA6;&#xFF1B;&#x4E0D;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x8BF4;&#x660E;&#x5B58;&#x5728;&#x534A;&#x5305;&#x60C5;&#x51B5;&#xFF0C;&#x8FD4;&#x56DE;null&#xFF1B;</li>
<li>&#x82E5;&#x6D88;&#x606F;&#x6570;&#x636E;&#x5B8C;&#x6574;&#xFF0C;&#x6784;&#x5EFA;&#x7528;&#x4E8E;&#x5B58;&#x653E;&#x6570;&#x636E;&#x7684;byte&#x6570;&#x7EC4;&#xFF0C;&#x901A;&#x8FC7;&#x6267;&#x884C;buffer.get()&#x8BBE;&#x7F6E;&#x6570;&#x7EC4;&#x957F;&#x5EA6;&#x3002;&#x6B64;get&#x65B9;&#x6CD5;&#x4F1A;&#x5BF9;buffer&#x7684;position&#x4F5C;&#x52A0;1&#x64CD;&#x4F5C;&#x3002;</li>
<li>&#x518D;&#x6B21;&#x6267;&#x884C;buffer.get&#x65B9;&#x6CD5;&#xFF0C;&#x4EE5;byte&#x6570;&#x7EC4;&#x4E3A;&#x5165;&#x53C2;&#x63A5;&#x53D7;&#x6D88;&#x606F;&#x4F53;&#x6570;&#x636E;&#xFF0C;&#x6B64;&#x64CD;&#x4F5C;&#x4E5F;&#x4F1A;&#x5F71;&#x54CD;buffer&#x7684;position&#xFF1B;</li>
<li>&#x6784;&#x5EFA;&#x5B57;&#x7B26;&#x4E32;&#x5BF9;&#x8C61;&#xFF0C;&#x89E3;&#x7801;&#x6210;&#x529F;&#x3002;</li>
</ol>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">StringProtocol</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">Protocol</span>&lt;<span class="hljs-title">String</span>&gt; </span>{
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">decode</span><span class="hljs-params">(ByteBuffer readBuffer, AioSession&lt;String&gt; session)</span> </span>{
        <span class="hljs-keyword">byte</span> length = readBuffer.get(readBuffer.position());<span class="hljs-comment">//1</span>
        <span class="hljs-keyword">if</span> (length+<span class="hljs-number">1</span> &lt; readBuffer.remaining()) {<span class="hljs-comment">//2</span>
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
        }
        <span class="hljs-keyword">byte</span>[] b = <span class="hljs-keyword">new</span> <span class="hljs-keyword">byte</span>[readBuffer.get()];<span class="hljs-comment">//3</span>
        readBuffer.get(b);<span class="hljs-comment">//4</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> String(b);<span class="hljs-comment">//5</span>
    }
}
</code></pre>
<h3 id="113-&#x670D;&#x52A1;&#x7AEF;">1.1.3 &#x670D;&#x52A1;&#x7AEF;</h3>
<p>&#x200B;&#x542F;&#x52A8;&#x670D;&#x52A1;&#x7AEF;&#x9700;&#x8981;&#x4F9D;&#x8D56;AioQuickServer&#xFF0C;&#x5B9E;&#x9645;&#x5E94;&#x7528;&#x4E2D;&#x7684;&#x8FD0;&#x884C;&#x53C2;&#x6570;&#x8C03;&#x4F18;&#x4E5F;&#x90FD;&#x662F;&#x5BF9;AioQuickServer&#x7684;&#x63A5;&#x53E3;&#x8FDB;&#x884C;&#x64CD;&#x4F5C;&#xFF0C;
&#x6B64;&#x5904;&#x5148;&#x5C55;&#x793A;&#x4E00;&#x4E0B;&#x5B83;&#x7684;&#x57FA;&#x672C;&#x5E94;&#x7528;&#x3002;</p>
<ol>
<li>&#x6784;&#x9020;&#x670D;&#x52A1;&#x7AEF;&#x5BF9;&#x8C61;AioQuickServer&#x3002;&#x8BE5;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x4E2A;&#x5165;&#x53C2;&#xFF1A;<ul>
<li>port&#xFF0C;&#x670D;&#x52A1;&#x7AEF;&#x76D1;&#x542C;&#x7AEF;&#x53E3;&#x53F7;&#xFF0C;&#x5BA2;&#x6237;&#x5EA6;&#x8981;&#x8BF7;&#x6C42;&#x8BE5;&#x7AEF;&#x53E3;&#x53F7;&#x624D;&#x53EF;&#x8FDE;&#x4E0A;&#x670D;&#x52A1;&#x7AEF;&#x3002;</li>
<li>Protocol&#xFF0C;&#x534F;&#x8BAE;&#x89E3;&#x7801;&#x7C7B;&#xFF0C;&#x5C06;ByteBuffer&#x4E2D;&#x5DF2;&#x8BFB;&#x90E8;&#x5206;&#x7684;byte&#x6570;&#x636E;&#x8FD8;&#x539F;&#x6210;&#x6D88;&#x606F;&#x5B9E;&#x4F53;</li>
<li>MessageProcessor&#xFF0C;&#x6D88;&#x606F;&#x5904;&#x7406;&#x5668;&#xFF0C;&#x5BF9;Protocol&#x89E3;&#x6790;&#x51FA;&#x6765;&#x7684;&#x6D88;&#x606F;&#x8FDB;&#x884C;&#x4E1A;&#x52A1;&#x5904;&#x7406;</li>
</ul>
</li>
<li>&#x542F;&#x52A8;Server&#x670D;&#x52A1;</li>
</ol>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Server</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> IOException </span>{
        <span class="hljs-comment">// 1</span>
        AioQuickServer&lt;String&gt; server = <span class="hljs-keyword">new</span> AioQuickServer&lt;String&gt;(<span class="hljs-number">8080</span>, <span class="hljs-keyword">new</span> StringProtocol(), <span class="hljs-keyword">new</span> MessageProcessor&lt;String&gt;() {
            <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">process</span><span class="hljs-params">(AioSession&lt;String&gt; session, String msg)</span> </span>{
                System.out.println(<span class="hljs-string">&quot;&#x63A5;&#x53D7;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#x6D88;&#x606F;:&quot;</span> + msg);

                <span class="hljs-keyword">byte</span>[] response = <span class="hljs-string">&quot;Hi Client!&quot;</span>.getBytes();
                <span class="hljs-keyword">byte</span>[] head = {(<span class="hljs-keyword">byte</span>) response.length};
                <span class="hljs-keyword">try</span> {
                    session.writeBuffer().write(head);
                    session.writeBuffer().write(response);
                } <span class="hljs-keyword">catch</span> (IOException e) {
                    e.printStackTrace();
                }
            }

            <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">stateEvent</span><span class="hljs-params">(AioSession&lt;String&gt; session, StateMachineEnum stateMachineEnum, Throwable throwable)</span> </span>{
            }
        });
        <span class="hljs-comment">//2</span>
        server.start();
    }
}
</code></pre>
<p>&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x4E2D;&#x542F;&#x52A8;&#x4E86;&#x7AEF;&#x53E3;&#x53F7;8080&#x7684;&#x670D;&#x52A1;&#x7AEF;&#x5E94;&#x7528;&#xFF0C;&#x5F53;&#x63A5;&#x6536;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#x53D1;&#x9001;&#x8FC7;&#x6765;&#x7684;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x670D;&#x52A1;&#x7AEF;&#x4EE5;StringProtocol&#x8FDB;&#x884C;&#x534F;&#x8BAE;&#x89E3;&#x7801;&#xFF0C;&#x8BC6;&#x522B;&#x51FA;&#x5BA2;&#x6237;&#x5EA6;&#x4F20;&#x9012;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x968F;&#x540E;&#x5C06;&#x8BE5;&#x6D88;&#x606F;&#x8F6C;&#x4EA4;&#x7ED9;&#x6D88;&#x606F;&#x5904;&#x7406;&#x5668;MessageProcessor&#x8FDB;&#x884C;&#x4E1A;&#x52A1;&#x5904;&#x7406;&#x3002;</p>
<h3 id="114-&#x5BA2;&#x6237;&#x7AEF;">1.1.4 &#x5BA2;&#x6237;&#x7AEF;</h3>
<p>&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x5F00;&#x53D1;&#x76F8;&#x8F83;&#x4E8E;&#x670D;&#x52A1;&#x7AEF;&#x5C31;&#x7B80;&#x5355;&#x5F88;&#x591A;&#xFF0C;&#x4EC5;&#x9700;&#x64CD;&#x4F5C;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x4F1A;&#x8BDD;&#xFF08;AioSession&#xFF09;&#x5373;&#x53EF;&#xFF0C;&#x800C;&#x670D;&#x52A1;&#x7AEF;&#x9762;&#x5411;&#x7684;&#x662F;&#x4F17;&#x591A;&#x8FDE;&#x63A5;&#x4F1A;&#x8BDD;&#xFF0C;&#x5728;&#x5B9E;&#x9645;&#x8FD0;&#x7528;&#x4E2D;&#x8FD8;&#x5F97;&#x5177;&#x5907;&#x5E76;&#x53D1;&#x601D;&#x7EF4;&#x4E0E;&#x4F1A;&#x8BDD;&#x8D44;&#x6E90;&#x7BA1;&#x7406;&#x7B56;&#x7565;&#x3002;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x5F00;&#x53D1;&#x6B65;&#x9AA4;&#x901A;&#x5E38;&#x5982;&#x4E0B;&#xFF1A;</p>
<ol>
<li>&#x8FDE;&#x63A5;&#x670D;&#x52A1;&#x7AEF;&#xFF0C;&#x53D6;&#x5F97;&#x8FDE;&#x63A5;&#x4F1A;&#x8BDD;&#xFF08;AioSession&#xFF09;</li>
<li>&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x6D88;&#x606F;</li>
<li>&#x5904;&#x7406;&#x54CD;&#x5E94;&#x6D88;&#x606F;</li>
<li>&#x5173;&#x95ED;&#x5BA2;&#x6237;&#x7AEF;</li>
</ol>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Client</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> InterruptedException, ExecutionException, IOException </span>{
        AioQuickClient&lt;String&gt; client = <span class="hljs-keyword">new</span> AioQuickClient&lt;String&gt;(<span class="hljs-string">&quot;127.0.0.1&quot;</span>, <span class="hljs-number">8080</span>, <span class="hljs-keyword">new</span> StringProtocol(), <span class="hljs-keyword">new</span> MessageProcessor&lt;String&gt;() {
            <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">process</span><span class="hljs-params">(AioSession&lt;String&gt; session, String msg)</span> </span>{
                System.out.println(msg);
            }

            <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">stateEvent</span><span class="hljs-params">(AioSession&lt;String&gt; session, StateMachineEnum stateMachineEnum, Throwable throwable)</span> </span>{
            }
        });

        AioSession&lt;String&gt; session = client.start();
        <span class="hljs-keyword">byte</span>[] msgBody = <span class="hljs-string">&quot;Hello Server!&quot;</span>.getBytes();
        <span class="hljs-keyword">byte</span>[] msgHead = {(<span class="hljs-keyword">byte</span>) msgBody.length};
        <span class="hljs-keyword">try</span> {
            session.writeBuffer().write(msgHead);
            session.writeBuffer().write(msgBody);
            session.writeBuffer().flush();
        } <span class="hljs-keyword">catch</span> (IOException e) {
            e.printStackTrace();
        }
    }
}
</code></pre>
<h3 id="115-&#x542F;&#x52A8;&#x8FD0;&#x884C;">1.1.5 &#x542F;&#x52A8;&#x8FD0;&#x884C;</h3>
<p>&#x5B8C;&#x6210;&#x4EE3;&#x7801;&#x7684;&#x7F16;&#x5199;&#x540E;&#x6211;&#x4EEC;&#x4FBF;&#x53EF;&#x5148;&#x540E;&#x542F;&#x52A8;&#x670D;&#x52A1;&#x7AEF;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x7A0B;&#x5E8F;&#xFF0C;&#x89C2;&#x5BDF;&#x901A;&#x4FE1;&#x670D;&#x52A1;&#x7684;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x3002;&#x670D;&#x52A1;&#x7AEF;&#x542F;&#x52A8;&#x6210;&#x529F;&#x540E;&#xFF0C;&#x4F1A;&#x5728;&#x63A7;&#x5236;&#x53F0;&#x6253;&#x5370;&#x5982;&#x4E0B;&#x4FE1;&#x606F;&#xFF0C;&#x5982;&#x542F;&#x52A8;&#x5931;&#x8D25;&#x8BF7;&#x68C0;&#x67E5;&#x662F;&#x5426;&#x5B58;&#x5728;&#x7AEF;&#x53E3;&#x88AB;&#x5360;&#x7528;&#x7684;&#x60C5;&#x51B5;&#x3002;</p>
<p><img src="2.1.5_1.png" width="80%"></p>
<p>&#x200B;    &#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x518D;&#x542F;&#x52A8;&#x5BA2;&#x6237;&#x7AEF;&#x7A0B;&#x5E8F;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x542F;&#x52A8;&#x6210;&#x529F;&#x540E;&#x4F1A;&#x76F4;&#x63A5;&#x53D1;&#x9001;&#x4E00;&#x4E2A;&#x201C;Hello Server!&#x201D;&#x7684;&#x6D88;&#x606F;&#x7ED9;&#x670D;&#x52A1;&#x7AEF;&#xFF0C;&#x5E76;&#x901A;&#x8FC7;&#x6D88;&#x606F;&#x5904;&#x7406;&#x5668;(MessageProcessor)&#x6253;&#x5370;&#x6240;&#x63A5;&#x53D7;&#x5230;&#x7684;&#x670D;&#x52A1;&#x7AEF;&#x54CD;&#x5E94;&#x6D88;&#x606F;&#x201C;Hi Client!&#x201D;&#x3002;</p>
<p><img src="2.1.5_2.png" width="80%"></p>
<p><img src="2.1.5_3.png" width="80%"></p>
<p>&#x81F3;&#x6B64;&#xFF0C;&#x6211;&#x4EEC;&#x91C7;&#x7528; smart-socket &#x987A;&#x5229;&#x5B8C;&#x6210;&#x4E86;&#x7B80;&#x6613;&#x7684;&#x901A;&#x4FE1;&#x670D;&#x52A1;&#x3002;&#x5982;&#x679C;&#x5BF9;&#x672C;&#x7AE0;&#x8282;&#x67D0;&#x4E2A;&#x77E5;&#x8BC6;&#x70B9;&#x8FD8;&#x4E0D;&#x751A;&#x6E05;&#x695A;&#xFF0C;&#x5EFA;&#x8BAE;&#x53CD;&#x590D;&#x9605;&#x8BFB;&#x52A0;&#x6DF1;&#x7406;&#x89E3;&#x6216;&#x8005;&#x4E0A;&#x7F51;&#x641C;&#x7D22;&#x540C;&#x7C7B;&#x4FE1;&#x606F;&#x3002;&#x5F53;&#x7136;&#xFF0C;&#x8DDF;&#x7740;&#x793A;&#x4F8B;&#x52A8;&#x624B;&#x6572;&#x4E00;&#x904D;&#x4EE3;&#x7801;&#x4E5F;&#x662F;&#x4E2A;&#x4E0D;&#x9519;&#x7684;&#x5B66;&#x4E60;&#x65B9;&#x5F0F;&#x3002; </p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; smartboot.org 2018 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-11-21 18:54:08
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="../2.2-Spring集成/" class="navigation navigation-next navigation-unique" aria-label="Next page: 1.2 Spring集成smart-socket">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1.1 快速上手","level":"1.2.2.1","depth":3,"next":{"title":"1.2 Spring集成smart-socket","level":"1.2.2.2","depth":3,"path":"smart-socket/chapter-1/2.2-Spring集成/README.md","ref":"smart-socket/chapter-1/2.2-Spring集成/README.md","articles":[]},"previous":{"title":"第一章 smart-socket开发指南","level":"1.2.2","depth":2,"ref":"","articles":[{"title":"1.1 快速上手","level":"1.2.2.1","depth":3,"path":"smart-socket/chapter-1/2.1-基础应用/README.md","ref":"smart-socket/chapter-1/2.1-基础应用/README.md","articles":[]},{"title":"1.2 Spring集成smart-socket","level":"1.2.2.2","depth":3,"path":"smart-socket/chapter-1/2.2-Spring集成/README.md","ref":"smart-socket/chapter-1/2.2-Spring集成/README.md","articles":[]},{"title":"小结","level":"1.2.2.3","depth":3,"path":"smart-socket/chapter-1/SUMMARY.md","ref":"smart-socket/chapter-1/SUMMARY.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","-sharing","search-plus","expandable-chapters-interactive","tbfed-pagefooter","github","github-buttons","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy smartboot.org 2018","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://github.com/smartboot/smart-socket"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"expandable-chapters-interactive":{},"github-buttons":{"buttons":[{"user":"smartboot","repo":"smart-socket","type":"star","size":"small","count":true}]},"edit-link":{"label":"Edit This Page","base":"https://gitee.com/smartboot/book/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"smartboot 中文指南","language":"en","gitbook":"*","description":"本文涵盖了smartboot下所有项目的技术手册"},"file":{"path":"smart-socket/chapter-1/2.1-基础应用/README.md","mtime":"2019-11-21T10:54:08.541Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2020-04-02T05:22:17.739Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

